// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Request for LookupServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupServiceProjectAttachmentRequest {
    /// Required. Service project ID and location to lookup service project
    /// attachment for. Only global location is supported. Expected format:
    /// `projects/{project}/locations/{location}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupServiceProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::LookupServiceProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for LookupServiceProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupServiceProjectAttachmentRequest"
    }
}

/// Response for LookupServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupServiceProjectAttachmentResponse {
    /// Service project attachment for a project if exists, empty otherwise.
    pub service_project_attachment: std::option::Option<crate::model::ServiceProjectAttachment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupServiceProjectAttachmentResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_project_attachment][crate::model::LookupServiceProjectAttachmentResponse::service_project_attachment].
    pub fn set_service_project_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProjectAttachment>,
    {
        self.service_project_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_project_attachment][crate::model::LookupServiceProjectAttachmentResponse::service_project_attachment].
    pub fn set_or_clear_service_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProjectAttachment>,
    {
        self.service_project_attachment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LookupServiceProjectAttachmentResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupServiceProjectAttachmentResponse"
    }
}

/// Request for ListServiceProjectAttachments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceProjectAttachmentsRequest {
    /// Required. Host project ID and location to list service project attachments.
    /// Only global location is supported. Expected format:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceProjectAttachmentsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServiceProjectAttachmentsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServiceProjectAttachmentsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServiceProjectAttachmentsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServiceProjectAttachmentsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServiceProjectAttachmentsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServiceProjectAttachmentsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListServiceProjectAttachmentsRequest"
    }
}

/// Response for ListServiceProjectAttachments.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceProjectAttachmentsResponse {
    /// List of service project attachments.
    pub service_project_attachments: std::vec::Vec<crate::model::ServiceProjectAttachment>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceProjectAttachmentsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_project_attachments][crate::model::ListServiceProjectAttachmentsResponse::service_project_attachments].
    pub fn set_service_project_attachments<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceProjectAttachment>,
    {
        use std::iter::Iterator;
        self.service_project_attachments = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServiceProjectAttachmentsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServiceProjectAttachmentsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServiceProjectAttachmentsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListServiceProjectAttachmentsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServiceProjectAttachmentsResponse {
    type PageItem = crate::model::ServiceProjectAttachment;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.service_project_attachments
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for CreateServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceProjectAttachmentRequest {
    /// Required. Host project ID and location to which service project is being
    /// attached. Only global location is supported. Expected format:
    /// `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. The service project attachment identifier must contain the
    /// project id of the service project specified in the
    /// service_project_attachment.service_project field.
    pub service_project_attachment_id: std::string::String,

    /// Required. The resource being created.
    pub service_project_attachment: std::option::Option<crate::model::ServiceProjectAttachment>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceProjectAttachmentRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_project_attachment_id][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment_id].
    pub fn set_service_project_attachment_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_project_attachment_id = v.into();
        self
    }

    /// Sets the value of [service_project_attachment][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment].
    pub fn set_service_project_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProjectAttachment>,
    {
        self.service_project_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_project_attachment][crate::model::CreateServiceProjectAttachmentRequest::service_project_attachment].
    pub fn set_or_clear_service_project_attachment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProjectAttachment>,
    {
        self.service_project_attachment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceProjectAttachmentRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.CreateServiceProjectAttachmentRequest"
    }
}

/// Request for GetServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceProjectAttachmentRequest {
    /// Required. Fully qualified name of the service project attachment to
    /// retrieve. Expected format:
    /// `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetServiceProjectAttachmentRequest"
    }
}

/// Request for DeleteServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceProjectAttachmentRequest {
    /// Required. Fully qualified name of the service project attachment to delete.
    /// Expected format:
    /// `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceProjectAttachmentRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteServiceProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DeleteServiceProjectAttachmentRequest"
    }
}

/// Request for DetachServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DetachServiceProjectAttachmentRequest {
    /// Required. Service project id and location to detach from a host project.
    /// Only global location is supported. Expected format:
    /// `projects/{project}/locations/{location}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DetachServiceProjectAttachmentRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DetachServiceProjectAttachmentRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DetachServiceProjectAttachmentRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DetachServiceProjectAttachmentRequest"
    }
}

/// Response for DetachServiceProjectAttachment.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DetachServiceProjectAttachmentResponse {
    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DetachServiceProjectAttachmentResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }
}

impl wkt::message::Message for DetachServiceProjectAttachmentResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DetachServiceProjectAttachmentResponse"
    }
}

/// Request for ListServices.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesRequest {
    /// Required. Fully qualified name of the parent Application to list Services
    /// for. Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServicesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServicesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServicesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServicesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListServicesRequest"
    }
}

/// Response for ListServices.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServicesResponse {
    /// List of Services.
    pub services: std::vec::Vec<crate::model::Service>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServicesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [services][crate::model::ListServicesResponse::services].
    pub fn set_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Service>,
    {
        use std::iter::Iterator;
        self.services = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServicesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServicesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListServicesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServicesResponse {
    type PageItem = crate::model::Service;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.services
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for ListDiscoveredServices.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredServicesRequest {
    /// Required. Project and location to list Discovered Services on.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredServicesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDiscoveredServicesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDiscoveredServicesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDiscoveredServicesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDiscoveredServicesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListDiscoveredServicesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredServicesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListDiscoveredServicesRequest"
    }
}

/// Response for ListDiscoveredServices.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredServicesResponse {
    /// List of Discovered Services.
    pub discovered_services: std::vec::Vec<crate::model::DiscoveredService>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredServicesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_services][crate::model::ListDiscoveredServicesResponse::discovered_services].
    pub fn set_discovered_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DiscoveredService>,
    {
        use std::iter::Iterator;
        self.discovered_services = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDiscoveredServicesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListDiscoveredServicesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListDiscoveredServicesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListDiscoveredServicesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDiscoveredServicesResponse {
    type PageItem = crate::model::DiscoveredService;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.discovered_services
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for CreateService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceRequest {
    /// Required. Fully qualified name of the parent Application to create the
    /// Service in. Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub parent: std::string::String,

    /// Required. The Service identifier.
    /// Must contain only lowercase letters, numbers
    /// or hyphens, with the first character a letter, the last a letter or a
    /// number, and a 63 character maximum.
    pub service_id: std::string::String,

    /// Required. The resource being created.
    pub service: std::option::Option<crate::model::Service>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
    pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_id = v.into();
        self
    }

    /// Sets the value of [service][crate::model::CreateServiceRequest::service].
    pub fn set_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.CreateServiceRequest"
    }
}

/// Request for GetService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceRequest {
    /// Required. Fully qualified name of the Service to fetch.
    /// Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetServiceRequest"
    }
}

/// Request for GetDiscoveredService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDiscoveredServiceRequest {
    /// Required. Fully qualified name of the Discovered Service to fetch.
    /// Expected format:
    /// `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDiscoveredServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDiscoveredServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDiscoveredServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetDiscoveredServiceRequest"
    }
}

/// Request for LookupDiscoveredService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupDiscoveredServiceRequest {
    /// Required. Host project ID and location to lookup Discovered Service in.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. Resource URI to find DiscoveredService for.
    /// Accepts both project number and project ID and does translation when
    /// needed.
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupDiscoveredServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::LookupDiscoveredServiceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [uri][crate::model::LookupDiscoveredServiceRequest::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for LookupDiscoveredServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupDiscoveredServiceRequest"
    }
}

/// Response for LookupDiscoveredService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupDiscoveredServiceResponse {
    /// Discovered Service if exists, empty otherwise.
    pub discovered_service: std::option::Option<crate::model::DiscoveredService>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupDiscoveredServiceResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_service][crate::model::LookupDiscoveredServiceResponse::discovered_service].
    pub fn set_discovered_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DiscoveredService>,
    {
        self.discovered_service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [discovered_service][crate::model::LookupDiscoveredServiceResponse::discovered_service].
    pub fn set_or_clear_discovered_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DiscoveredService>,
    {
        self.discovered_service = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LookupDiscoveredServiceResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupDiscoveredServiceResponse"
    }
}

/// Request for UpdateService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Service resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request.
    /// The API changes the values of the fields as specified in the update_mask.
    /// The API ignores the values of all fields not covered by the update_mask.
    /// You can also unset a field by not specifying it in the updated message, but
    /// adding the field to the mask. This clears whatever value the field
    /// previously had.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated.
    pub service: std::option::Option<crate::model::Service>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
    pub fn set_service<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
    pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Service>,
    {
        self.service = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.UpdateServiceRequest"
    }
}

/// Request for DeleteService.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceRequest {
    /// Required. Fully qualified name of the Service to delete from an
    /// Application. Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}/services/{service}`.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DeleteServiceRequest"
    }
}

/// Request for ListApplications.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApplicationsRequest {
    /// Required. Project and location to list Applications on.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApplicationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListApplicationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListApplicationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListApplicationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListApplicationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListApplicationsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListApplicationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListApplicationsRequest"
    }
}

/// Response for ListApplications.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListApplicationsResponse {
    /// List of Applications.
    pub applications: std::vec::Vec<crate::model::Application>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListApplicationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [applications][crate::model::ListApplicationsResponse::applications].
    pub fn set_applications<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Application>,
    {
        use std::iter::Iterator;
        self.applications = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListApplicationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListApplicationsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListApplicationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListApplicationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListApplicationsResponse {
    type PageItem = crate::model::Application;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.applications
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for CreateApplication.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateApplicationRequest {
    /// Required. Project and location to create Application in.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. The Application identifier.
    /// Must contain only lowercase letters, numbers
    /// or hyphens, with the first character a letter, the last a letter or a
    /// number, and a 63 character maximum.
    pub application_id: std::string::String,

    /// Required. The resource being created
    pub application: std::option::Option<crate::model::Application>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateApplicationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateApplicationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [application_id][crate::model::CreateApplicationRequest::application_id].
    pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.application_id = v.into();
        self
    }

    /// Sets the value of [application][crate::model::CreateApplicationRequest::application].
    pub fn set_application<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Application>,
    {
        self.application = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [application][crate::model::CreateApplicationRequest::application].
    pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Application>,
    {
        self.application = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateApplicationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateApplicationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.CreateApplicationRequest"
    }
}

/// Request for GetApplication.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetApplicationRequest {
    /// Required. Fully qualified name of the Application to fetch.
    /// Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetApplicationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetApplicationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetApplicationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetApplicationRequest"
    }
}

/// Request for UpdateApplication.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateApplicationRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Application resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request.
    /// The API changes the values of the fields as specified in the update_mask.
    /// The API ignores the values of all fields not covered by the update_mask.
    /// You can also unset a field by not specifying it in the updated message, but
    /// adding the field to the mask. This clears whatever value the field
    /// previously had.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated.
    pub application: std::option::Option<crate::model::Application>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateApplicationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateApplicationRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [application][crate::model::UpdateApplicationRequest::application].
    pub fn set_application<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Application>,
    {
        self.application = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [application][crate::model::UpdateApplicationRequest::application].
    pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Application>,
    {
        self.application = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateApplicationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateApplicationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.UpdateApplicationRequest"
    }
}

/// Request for DeleteApplication.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteApplicationRequest {
    /// Required. Fully qualified name of the Application to delete.
    /// Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteApplicationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteApplicationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteApplicationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteApplicationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DeleteApplicationRequest"
    }
}

/// Request for ListWorkloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkloadsRequest {
    /// Required. Fully qualified name of the parent Application to list Workloads
    /// for. Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkloadsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListWorkloadsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListWorkloadsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListWorkloadsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListWorkloadsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListWorkloadsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListWorkloadsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListWorkloadsRequest"
    }
}

/// Response for ListWorkloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWorkloadsResponse {
    /// List of Workloads.
    pub workloads: std::vec::Vec<crate::model::Workload>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListWorkloadsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [workloads][crate::model::ListWorkloadsResponse::workloads].
    pub fn set_workloads<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Workload>,
    {
        use std::iter::Iterator;
        self.workloads = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListWorkloadsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListWorkloadsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListWorkloadsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListWorkloadsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListWorkloadsResponse {
    type PageItem = crate::model::Workload;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.workloads
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for ListDiscoveredWorkloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredWorkloadsRequest {
    /// Required. Project and location to list Discovered Workloads on.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Optional. Requested page size. Server may return fewer items than
    /// requested. If unspecified, server will pick an appropriate default.
    pub page_size: i32,

    /// Optional. A token identifying a page of results the server should return.
    pub page_token: std::string::String,

    /// Optional. Filtering results.
    pub filter: std::string::String,

    /// Optional. Hint for how to order the results.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredWorkloadsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDiscoveredWorkloadsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDiscoveredWorkloadsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDiscoveredWorkloadsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDiscoveredWorkloadsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListDiscoveredWorkloadsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListDiscoveredWorkloadsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListDiscoveredWorkloadsRequest"
    }
}

/// Response for ListDiscoveredWorkloads.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDiscoveredWorkloadsResponse {
    /// List of Discovered Workloads.
    pub discovered_workloads: std::vec::Vec<crate::model::DiscoveredWorkload>,

    /// A token identifying a page of results the server should return.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDiscoveredWorkloadsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_workloads][crate::model::ListDiscoveredWorkloadsResponse::discovered_workloads].
    pub fn set_discovered_workloads<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::DiscoveredWorkload>,
    {
        use std::iter::Iterator;
        self.discovered_workloads = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDiscoveredWorkloadsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListDiscoveredWorkloadsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListDiscoveredWorkloadsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ListDiscoveredWorkloadsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDiscoveredWorkloadsResponse {
    type PageItem = crate::model::DiscoveredWorkload;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.discovered_workloads
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for CreateWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateWorkloadRequest {
    /// Required. Fully qualified name of the Application to create Workload in.
    /// Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}`.
    pub parent: std::string::String,

    /// Required. The Workload identifier.
    /// Must contain only lowercase letters, numbers
    /// or hyphens, with the first character a letter, the last a letter or a
    /// number, and a 63 character maximum.
    pub workload_id: std::string::String,

    /// Required. The resource being created.
    pub workload: std::option::Option<crate::model::Workload>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateWorkloadRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [workload_id][crate::model::CreateWorkloadRequest::workload_id].
    pub fn set_workload_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.workload_id = v.into();
        self
    }

    /// Sets the value of [workload][crate::model::CreateWorkloadRequest::workload].
    pub fn set_workload<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload][crate::model::CreateWorkloadRequest::workload].
    pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateWorkloadRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.CreateWorkloadRequest"
    }
}

/// Request for GetWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWorkloadRequest {
    /// Required. Fully qualified name of the Workload to fetch.
    /// Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetWorkloadRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetWorkloadRequest"
    }
}

/// Request for GetDiscoveredWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDiscoveredWorkloadRequest {
    /// Required. Fully qualified name of the Discovered Workload to fetch.
    /// Expected format:
    /// `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDiscoveredWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDiscoveredWorkloadRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDiscoveredWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.GetDiscoveredWorkloadRequest"
    }
}

/// Request for LookupDiscoveredWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupDiscoveredWorkloadRequest {
    /// Required. Host project ID and location to lookup Discovered Workload in.
    /// Expected format: `projects/{project}/locations/{location}`.
    pub parent: std::string::String,

    /// Required. Resource URI to find Discovered Workload for.
    /// Accepts both project number and project ID and does translation when
    /// needed.
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupDiscoveredWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::LookupDiscoveredWorkloadRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [uri][crate::model::LookupDiscoveredWorkloadRequest::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for LookupDiscoveredWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupDiscoveredWorkloadRequest"
    }
}

/// Response for LookupDiscoveredWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LookupDiscoveredWorkloadResponse {
    /// Discovered Workload if exists, empty otherwise.
    pub discovered_workload: std::option::Option<crate::model::DiscoveredWorkload>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LookupDiscoveredWorkloadResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [discovered_workload][crate::model::LookupDiscoveredWorkloadResponse::discovered_workload].
    pub fn set_discovered_workload<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::DiscoveredWorkload>,
    {
        self.discovered_workload = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [discovered_workload][crate::model::LookupDiscoveredWorkloadResponse::discovered_workload].
    pub fn set_or_clear_discovered_workload<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::DiscoveredWorkload>,
    {
        self.discovered_workload = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for LookupDiscoveredWorkloadResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.LookupDiscoveredWorkloadResponse"
    }
}

/// Request for UpdateWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWorkloadRequest {
    /// Required. Field mask is used to specify the fields to be overwritten in the
    /// Workload resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request.
    /// The API changes the values of the fields as specified in the update_mask.
    /// The API ignores the values of all fields not covered by the update_mask.
    /// You can also unset a field by not specifying it in the updated message, but
    /// adding the field to the mask. This clears whatever value the field
    /// previously had.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The resource being updated.
    pub workload: std::option::Option<crate::model::Workload>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateWorkloadRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workload][crate::model::UpdateWorkloadRequest::workload].
    pub fn set_workload<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload][crate::model::UpdateWorkloadRequest::workload].
    pub fn set_or_clear_workload<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Workload>,
    {
        self.workload = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateWorkloadRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.UpdateWorkloadRequest"
    }
}

/// Request for DeleteWorkload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWorkloadRequest {
    /// Required. Fully qualified name of the Workload to delete from an
    /// Application. Expected format:
    /// `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and the
    /// request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteWorkloadRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteWorkloadRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteWorkloadRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteWorkloadRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DeleteWorkloadRequest"
    }
}

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have been cancelled successfully
    /// have
    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
    /// corresponding to `Code.CANCELLED`.
    ///
    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.OperationMetadata"
    }
}

/// Application defines the governance boundary for App Hub entities that
/// perform a logical end-to-end business function.
/// App Hub supports application level IAM permission to align with governance
/// requirements.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Application {
    /// Identifier. The resource name of an Application. Format:
    /// `"projects/{host-project-id}/locations/{location}/applications/{application-id}"`
    pub name: std::string::String,

    /// Optional. User-defined name for the Application.
    /// Can have a maximum length of 63 characters.
    pub display_name: std::string::String,

    /// Optional. User-defined description of an Application.
    /// Can have a maximum length of 2048 characters.
    pub description: std::string::String,

    /// Optional. Consumer provided attributes.
    pub attributes: std::option::Option<crate::model::Attributes>,

    /// Output only. Create time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Required. Immutable. Defines what data can be included into this
    /// Application. Limits which Services and Workloads can be registered.
    pub scope: std::option::Option<crate::model::Scope>,

    /// Output only. A universally unique identifier (in UUID4 format) for the
    /// `Application`.
    pub uid: std::string::String,

    /// Output only. Application state.
    pub state: crate::model::application::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Application {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Application::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Application::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Application::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [attributes][crate::model::Application::attributes].
    pub fn set_attributes<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attributes][crate::model::Application::attributes].
    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Application::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Application::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Application::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Application::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [scope][crate::model::Application::scope].
    pub fn set_scope<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Scope>,
    {
        self.scope = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [scope][crate::model::Application::scope].
    pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Scope>,
    {
        self.scope = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Application::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Application::state].
    pub fn set_state<T: std::convert::Into<crate::model::application::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for Application {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Application"
    }
}

/// Defines additional types related to [Application].
pub mod application {
    #[allow(unused_imports)]
    use super::*;

    /// Application state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified state.
        Unspecified,
        /// The Application is being created.
        Creating,
        /// The Application is ready to register Services and Workloads.
        Active,
        /// The Application is being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apphub.v1.Application.State",
            ))
        }
    }
}

/// Scope of an application.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Scope {
    /// Required. Scope Type.
    pub r#type: crate::model::scope::Type,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Scope {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [r#type][crate::model::Scope::type].
    pub fn set_type<T: std::convert::Into<crate::model::scope::Type>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }
}

impl wkt::message::Message for Scope {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Scope"
    }
}

/// Defines additional types related to [Scope].
pub mod scope {
    #[allow(unused_imports)]
    use super::*;

    /// Scope Type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Unspecified type.
        Unspecified,
        /// Regional type.
        Regional,
        /// Global type.
        Global,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Regional => std::option::Option::Some(1),
                Self::Global => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::Regional => std::option::Option::Some("REGIONAL"),
                Self::Global => std::option::Option::Some("GLOBAL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Regional,
                2 => Self::Global,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "REGIONAL" => Self::Regional,
                "GLOBAL" => Self::Global,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Regional => serializer.serialize_i32(1),
                Self::Global => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.apphub.v1.Scope.Type",
            ))
        }
    }
}

/// Consumer provided attributes.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Attributes {
    /// Optional. User-defined criticality information.
    pub criticality: std::option::Option<crate::model::Criticality>,

    /// Optional. User-defined environment information.
    pub environment: std::option::Option<crate::model::Environment>,

    /// Optional. Developer team that owns development and coding.
    pub developer_owners: std::vec::Vec<crate::model::ContactInfo>,

    /// Optional. Operator team that ensures runtime and operations.
    pub operator_owners: std::vec::Vec<crate::model::ContactInfo>,

    /// Optional. Business team that ensures user needs are met and value is
    /// delivered
    pub business_owners: std::vec::Vec<crate::model::ContactInfo>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Attributes {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [criticality][crate::model::Attributes::criticality].
    pub fn set_criticality<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Criticality>,
    {
        self.criticality = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [criticality][crate::model::Attributes::criticality].
    pub fn set_or_clear_criticality<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Criticality>,
    {
        self.criticality = v.map(|x| x.into());
        self
    }

    /// Sets the value of [environment][crate::model::Attributes::environment].
    pub fn set_environment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Environment>,
    {
        self.environment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [environment][crate::model::Attributes::environment].
    pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Environment>,
    {
        self.environment = v.map(|x| x.into());
        self
    }

    /// Sets the value of [developer_owners][crate::model::Attributes::developer_owners].
    pub fn set_developer_owners<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ContactInfo>,
    {
        use std::iter::Iterator;
        self.developer_owners = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [operator_owners][crate::model::Attributes::operator_owners].
    pub fn set_operator_owners<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ContactInfo>,
    {
        use std::iter::Iterator;
        self.operator_owners = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [business_owners][crate::model::Attributes::business_owners].
    pub fn set_business_owners<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ContactInfo>,
    {
        use std::iter::Iterator;
        self.business_owners = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Attributes {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Attributes"
    }
}

/// Criticality of the Application, Service, or Workload
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Criticality {
    /// Required. Criticality Type.
    pub r#type: crate::model::criticality::Type,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Criticality {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [r#type][crate::model::Criticality::type].
    pub fn set_type<T: std::convert::Into<crate::model::criticality::Type>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }
}

impl wkt::message::Message for Criticality {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Criticality"
    }
}

/// Defines additional types related to [Criticality].
pub mod criticality {
    #[allow(unused_imports)]
    use super::*;

    /// Criticality Type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Unspecified type.
        Unspecified,
        /// Mission critical service, application or workload.
        MissionCritical,
        /// High impact.
        High,
        /// Medium impact.
        Medium,
        /// Low impact.
        Low,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::MissionCritical => std::option::Option::Some(1),
                Self::High => std::option::Option::Some(2),
                Self::Medium => std::option::Option::Some(3),
                Self::Low => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::MissionCritical => std::option::Option::Some("MISSION_CRITICAL"),
                Self::High => std::option::Option::Some("HIGH"),
                Self::Medium => std::option::Option::Some("MEDIUM"),
                Self::Low => std::option::Option::Some("LOW"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::MissionCritical,
                2 => Self::High,
                3 => Self::Medium,
                4 => Self::Low,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "MISSION_CRITICAL" => Self::MissionCritical,
                "HIGH" => Self::High,
                "MEDIUM" => Self::Medium,
                "LOW" => Self::Low,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::MissionCritical => serializer.serialize_i32(1),
                Self::High => serializer.serialize_i32(2),
                Self::Medium => serializer.serialize_i32(3),
                Self::Low => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.apphub.v1.Criticality.Type",
            ))
        }
    }
}

/// Environment of the Application, Service, or Workload
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Environment {
    /// Required. Environment Type.
    pub r#type: crate::model::environment::Type,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Environment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [r#type][crate::model::Environment::type].
    pub fn set_type<T: std::convert::Into<crate::model::environment::Type>>(
        mut self,
        v: T,
    ) -> Self {
        self.r#type = v.into();
        self
    }
}

impl wkt::message::Message for Environment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Environment"
    }
}

/// Defines additional types related to [Environment].
pub mod environment {
    #[allow(unused_imports)]
    use super::*;

    /// Environment Type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Type {
        /// Unspecified type.
        Unspecified,
        /// Production environment.
        Production,
        /// Staging environment.
        Staging,
        /// Test environment.
        Test,
        /// Development environment.
        Development,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Type::value] or
        /// [Type::name].
        UnknownValue(r#type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod r#type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Type {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Production => std::option::Option::Some(1),
                Self::Staging => std::option::Option::Some(2),
                Self::Test => std::option::Option::Some(3),
                Self::Development => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
                Self::Production => std::option::Option::Some("PRODUCTION"),
                Self::Staging => std::option::Option::Some("STAGING"),
                Self::Test => std::option::Option::Some("TEST"),
                Self::Development => std::option::Option::Some("DEVELOPMENT"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Type {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Type {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Type {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Production,
                2 => Self::Staging,
                3 => Self::Test,
                4 => Self::Development,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Type {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "TYPE_UNSPECIFIED" => Self::Unspecified,
                "PRODUCTION" => Self::Production,
                "STAGING" => Self::Staging,
                "TEST" => Self::Test,
                "DEVELOPMENT" => Self::Development,
                _ => Self::UnknownValue(r#type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Type {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Production => serializer.serialize_i32(1),
                Self::Staging => serializer.serialize_i32(2),
                Self::Test => serializer.serialize_i32(3),
                Self::Development => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Type {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
                ".google.cloud.apphub.v1.Environment.Type",
            ))
        }
    }
}

/// Contact information of stakeholders.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContactInfo {
    /// Optional. Contact's name.
    /// Can have a maximum length of 63 characters.
    pub display_name: std::string::String,

    /// Required. Email address of the contacts.
    pub email: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ContactInfo {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [display_name][crate::model::ContactInfo::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [email][crate::model::ContactInfo::email].
    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.email = v.into();
        self
    }
}

impl wkt::message::Message for ContactInfo {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ContactInfo"
    }
}

/// Service is an App Hub data model that contains a discovered service, which
/// represents a network or API interface that exposes some functionality to
/// clients for consumption over the network.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Service {
    /// Identifier. The resource name of a Service. Format:
    /// `"projects/{host-project-id}/locations/{location}/applications/{application-id}/services/{service-id}"`
    pub name: std::string::String,

    /// Optional. User-defined name for the Service.
    /// Can have a maximum length of 63 characters.
    pub display_name: std::string::String,

    /// Optional. User-defined description of a Service.
    /// Can have a maximum length of 2048 characters.
    pub description: std::string::String,

    /// Output only. Reference to an underlying networking resource that can
    /// comprise a Service. These are immutable.
    pub service_reference: std::option::Option<crate::model::ServiceReference>,

    /// Output only. Properties of an underlying compute resource that can comprise
    /// a Service. These are immutable.
    pub service_properties: std::option::Option<crate::model::ServiceProperties>,

    /// Optional. Consumer provided attributes.
    pub attributes: std::option::Option<crate::model::Attributes>,

    /// Required. Immutable. The resource name of the original discovered service.
    pub discovered_service: std::string::String,

    /// Output only. Create time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. A universally unique identifier (UUID) for the `Service` in
    /// the UUID4 format.
    pub uid: std::string::String,

    /// Output only. Service state.
    pub state: crate::model::service::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Service {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Service::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Service::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Service::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [service_reference][crate::model::Service::service_reference].
    pub fn set_service_reference<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceReference>,
    {
        self.service_reference = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_reference][crate::model::Service::service_reference].
    pub fn set_or_clear_service_reference<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceReference>,
    {
        self.service_reference = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service_properties][crate::model::Service::service_properties].
    pub fn set_service_properties<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProperties>,
    {
        self.service_properties = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_properties][crate::model::Service::service_properties].
    pub fn set_or_clear_service_properties<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProperties>,
    {
        self.service_properties = v.map(|x| x.into());
        self
    }

    /// Sets the value of [attributes][crate::model::Service::attributes].
    pub fn set_attributes<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attributes][crate::model::Service::attributes].
    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = v.map(|x| x.into());
        self
    }

    /// Sets the value of [discovered_service][crate::model::Service::discovered_service].
    pub fn set_discovered_service<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.discovered_service = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Service::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Service::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Service::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Service::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Service::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Service::state].
    pub fn set_state<T: std::convert::Into<crate::model::service::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for Service {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Service"
    }
}

/// Defines additional types related to [Service].
pub mod service {
    #[allow(unused_imports)]
    use super::*;

    /// Service state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified state.
        Unspecified,
        /// The service is being created.
        Creating,
        /// The service is ready.
        Active,
        /// The service is being deleted.
        Deleting,
        /// The underlying networking resources have been deleted.
        Detached,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::Detached => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Detached => std::option::Option::Some("DETACHED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                4 => Self::Detached,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                "DETACHED" => Self::Detached,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::Detached => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apphub.v1.Service.State",
            ))
        }
    }
}

/// Reference to an underlying networking resource that can comprise a Service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceReference {
    /// Output only. The underlying resource URI. For example, URI of Forwarding
    /// Rule, URL Map, and Backend Service.
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceReference {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::ServiceReference::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for ServiceReference {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ServiceReference"
    }
}

/// Properties of an underlying cloud resource that can comprise a Service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceProperties {
    /// Output only. The service project identifier that the underlying cloud
    /// resource resides in.
    pub gcp_project: std::string::String,

    /// Output only. The location that the underlying resource resides in, for
    /// example, us-west1.
    pub location: std::string::String,

    /// Output only. The location that the underlying resource resides in if it is
    /// zonal, for example, us-west1-a).
    pub zone: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceProperties {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [gcp_project][crate::model::ServiceProperties::gcp_project].
    pub fn set_gcp_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.gcp_project = v.into();
        self
    }

    /// Sets the value of [location][crate::model::ServiceProperties::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [zone][crate::model::ServiceProperties::zone].
    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.zone = v.into();
        self
    }
}

impl wkt::message::Message for ServiceProperties {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ServiceProperties"
    }
}

/// DiscoveredService is a network or API interface that exposes some
/// functionality to clients for consumption over the network. A discovered
/// service can be registered to a App Hub service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveredService {
    /// Identifier. The resource name of the discovered service. Format:
    /// `"projects/{host-project-id}/locations/{location}/discoveredServices/{uuid}"`
    pub name: std::string::String,

    /// Output only. Reference to an underlying networking resource that can
    /// comprise a Service. These are immutable.
    pub service_reference: std::option::Option<crate::model::ServiceReference>,

    /// Output only. Properties of an underlying compute resource that can comprise
    /// a Service. These are immutable.
    pub service_properties: std::option::Option<crate::model::ServiceProperties>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiscoveredService {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiscoveredService::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [service_reference][crate::model::DiscoveredService::service_reference].
    pub fn set_service_reference<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceReference>,
    {
        self.service_reference = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_reference][crate::model::DiscoveredService::service_reference].
    pub fn set_or_clear_service_reference<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceReference>,
    {
        self.service_reference = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service_properties][crate::model::DiscoveredService::service_properties].
    pub fn set_service_properties<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProperties>,
    {
        self.service_properties = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_properties][crate::model::DiscoveredService::service_properties].
    pub fn set_or_clear_service_properties<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceProperties>,
    {
        self.service_properties = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiscoveredService {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DiscoveredService"
    }
}

/// ServiceProjectAttachment represents an attachment from a service project to a
/// host project. Service projects contain the underlying cloud
/// infrastructure resources, and expose these resources to the host project
/// through a ServiceProjectAttachment. With the attachments, the host project
/// can provide an aggregated view of resources across all service projects.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceProjectAttachment {
    /// Identifier. The resource name of a ServiceProjectAttachment. Format:
    /// `"projects/{host-project-id}/locations/global/serviceProjectAttachments/{service-project-id}."`
    pub name: std::string::String,

    /// Required. Immutable. Service project name in the format: `"projects/abc"`
    /// or `"projects/123"`. As input, project name with either project id or
    /// number are accepted. As output, this field will contain project number.
    pub service_project: std::string::String,

    /// Output only. Create time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. A globally unique identifier (in UUID4 format) for the
    /// `ServiceProjectAttachment`.
    pub uid: std::string::String,

    /// Output only. ServiceProjectAttachment state.
    pub state: crate::model::service_project_attachment::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceProjectAttachment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ServiceProjectAttachment::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [service_project][crate::model::ServiceProjectAttachment::service_project].
    pub fn set_service_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_project = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ServiceProjectAttachment::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ServiceProjectAttachment::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::ServiceProjectAttachment::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::ServiceProjectAttachment::state].
    pub fn set_state<T: std::convert::Into<crate::model::service_project_attachment::State>>(
        mut self,
        v: T,
    ) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for ServiceProjectAttachment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.ServiceProjectAttachment"
    }
}

/// Defines additional types related to [ServiceProjectAttachment].
pub mod service_project_attachment {
    #[allow(unused_imports)]
    use super::*;

    /// ServiceProjectAttachment state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified state.
        Unspecified,
        /// The ServiceProjectAttachment is being created.
        Creating,
        /// The ServiceProjectAttachment is ready.
        /// This means Services and Workloads under the corresponding
        /// ServiceProjectAttachment is ready for registration.
        Active,
        /// The ServiceProjectAttachment is being deleted.
        Deleting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apphub.v1.ServiceProjectAttachment.State",
            ))
        }
    }
}

/// Workload is an App Hub data model that contains a discovered workload, which
/// represents a binary deployment (such as managed instance groups (MIGs) and
/// GKE deployments) that performs the smallest logical subset of business
/// functionality.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Workload {
    /// Identifier. The resource name of the Workload. Format:
    /// `"projects/{host-project-id}/locations/{location}/applications/{application-id}/workloads/{workload-id}"`
    pub name: std::string::String,

    /// Optional. User-defined name for the Workload.
    /// Can have a maximum length of 63 characters.
    pub display_name: std::string::String,

    /// Optional. User-defined description of a Workload.
    /// Can have a maximum length of 2048 characters.
    pub description: std::string::String,

    /// Output only. Reference of an underlying compute resource represented by the
    /// Workload. These are immutable.
    pub workload_reference: std::option::Option<crate::model::WorkloadReference>,

    /// Output only. Properties of an underlying compute resource represented by
    /// the Workload. These are immutable.
    pub workload_properties: std::option::Option<crate::model::WorkloadProperties>,

    /// Required. Immutable. The resource name of the original discovered workload.
    pub discovered_workload: std::string::String,

    /// Optional. Consumer provided attributes.
    pub attributes: std::option::Option<crate::model::Attributes>,

    /// Output only. Create time.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Update time.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. A universally unique identifier (UUID) for the `Workload` in
    /// the UUID4 format.
    pub uid: std::string::String,

    /// Output only. Workload state.
    pub state: crate::model::workload::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Workload {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Workload::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [display_name][crate::model::Workload::display_name].
    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.display_name = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Workload::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [workload_reference][crate::model::Workload::workload_reference].
    pub fn set_workload_reference<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadReference>,
    {
        self.workload_reference = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload_reference][crate::model::Workload::workload_reference].
    pub fn set_or_clear_workload_reference<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadReference>,
    {
        self.workload_reference = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workload_properties][crate::model::Workload::workload_properties].
    pub fn set_workload_properties<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadProperties>,
    {
        self.workload_properties = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload_properties][crate::model::Workload::workload_properties].
    pub fn set_or_clear_workload_properties<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadProperties>,
    {
        self.workload_properties = v.map(|x| x.into());
        self
    }

    /// Sets the value of [discovered_workload][crate::model::Workload::discovered_workload].
    pub fn set_discovered_workload<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.discovered_workload = v.into();
        self
    }

    /// Sets the value of [attributes][crate::model::Workload::attributes].
    pub fn set_attributes<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [attributes][crate::model::Workload::attributes].
    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Attributes>,
    {
        self.attributes = v.map(|x| x.into());
        self
    }

    /// Sets the value of [create_time][crate::model::Workload::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Workload::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Workload::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Workload::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Workload::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Workload::state].
    pub fn set_state<T: std::convert::Into<crate::model::workload::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for Workload {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.Workload"
    }
}

/// Defines additional types related to [Workload].
pub mod workload {
    #[allow(unused_imports)]
    use super::*;

    /// Workload state.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// Unspecified state.
        Unspecified,
        /// The Workload is being created.
        Creating,
        /// The Workload is ready.
        Active,
        /// The Workload is being deleted.
        Deleting,
        /// The underlying compute resources have been deleted.
        Detached,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Creating => std::option::Option::Some(1),
                Self::Active => std::option::Option::Some(2),
                Self::Deleting => std::option::Option::Some(3),
                Self::Detached => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::Detached => std::option::Option::Some("DETACHED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Creating,
                2 => Self::Active,
                3 => Self::Deleting,
                4 => Self::Detached,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "CREATING" => Self::Creating,
                "ACTIVE" => Self::Active,
                "DELETING" => Self::Deleting,
                "DETACHED" => Self::Detached,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Creating => serializer.serialize_i32(1),
                Self::Active => serializer.serialize_i32(2),
                Self::Deleting => serializer.serialize_i32(3),
                Self::Detached => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.apphub.v1.Workload.State",
            ))
        }
    }
}

/// Reference of an underlying compute resource represented by the Workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkloadReference {
    /// Output only. The underlying compute resource uri.
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WorkloadReference {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::WorkloadReference::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for WorkloadReference {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.WorkloadReference"
    }
}

/// Properties of an underlying compute resource represented by the Workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WorkloadProperties {
    /// Output only. The service project identifier that the underlying cloud
    /// resource resides in. Empty for non-cloud resources.
    pub gcp_project: std::string::String,

    /// Output only. The location that the underlying compute resource resides in
    /// (for example, us-west1).
    pub location: std::string::String,

    /// Output only. The location that the underlying compute resource resides in
    /// if it is zonal (for example, us-west1-a).
    pub zone: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl WorkloadProperties {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [gcp_project][crate::model::WorkloadProperties::gcp_project].
    pub fn set_gcp_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.gcp_project = v.into();
        self
    }

    /// Sets the value of [location][crate::model::WorkloadProperties::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [zone][crate::model::WorkloadProperties::zone].
    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.zone = v.into();
        self
    }
}

impl wkt::message::Message for WorkloadProperties {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.WorkloadProperties"
    }
}

/// DiscoveredWorkload is a binary deployment (such as managed instance groups
/// (MIGs) and GKE deployments) that performs the smallest logical subset of
/// business functionality. A discovered workload can be registered to an App Hub
/// Workload.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DiscoveredWorkload {
    /// Identifier. The resource name of the discovered workload. Format:
    /// `"projects/{host-project-id}/locations/{location}/discoveredWorkloads/{uuid}"`
    pub name: std::string::String,

    /// Output only. Reference of an underlying compute resource represented by the
    /// Workload. These are immutable.
    pub workload_reference: std::option::Option<crate::model::WorkloadReference>,

    /// Output only. Properties of an underlying compute resource represented by
    /// the Workload. These are immutable.
    pub workload_properties: std::option::Option<crate::model::WorkloadProperties>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DiscoveredWorkload {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DiscoveredWorkload::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [workload_reference][crate::model::DiscoveredWorkload::workload_reference].
    pub fn set_workload_reference<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadReference>,
    {
        self.workload_reference = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload_reference][crate::model::DiscoveredWorkload::workload_reference].
    pub fn set_or_clear_workload_reference<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadReference>,
    {
        self.workload_reference = v.map(|x| x.into());
        self
    }

    /// Sets the value of [workload_properties][crate::model::DiscoveredWorkload::workload_properties].
    pub fn set_workload_properties<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadProperties>,
    {
        self.workload_properties = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [workload_properties][crate::model::DiscoveredWorkload::workload_properties].
    pub fn set_or_clear_workload_properties<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::WorkloadProperties>,
    {
        self.workload_properties = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DiscoveredWorkload {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.apphub.v1.DiscoveredWorkload"
    }
}
